﻿//----------------------------------------------------------------
//CodeArt (2007)
//
//Author: jianyi0115@163.com
//Created: 2010-9-13
//
//History:
// 
//----------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;

namespace CodeArt.SharePoint.CamlQuery
{
    public class LookupQueryField : TypedQueryField<int>
    {
        /// <summary>
        /// Lookup查询，直接按照ID比较
        /// </summary>
        /// <param name="name">internal name of field</param>
        public LookupQueryField(string name)
            : base(name)
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="name">internal or display name of field</param>
        /// <param name="isInternalName">if the first parameter is a internal name</param>
        public LookupQueryField(string name, bool isInternalName)
            : base(name, isInternalName)
        {
        }

        protected override CamlExpression CreateExpression(string op, object value)
        {
            SingleCamlExpression q = new SingleCamlExpression(this.FieldName, op, value, typeof(SPFieldLookupValue), this.IsInternalName);
            return q;
        }   
    }
}
